package pipe.reader.writer;

import java.io.IOException;
import java.io.PipedWriter;

public class WriteData {
    public void writeMethod(PipedWriter out) {
        System.out.println("write:");
        try {
            for (int i = 0; i < 300; i++) {
                String outdata = "" + (i + 1);

                out.write(outdata);

                System.out.println(outdata);

                out.close();

            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
